package com.youyou;

import entity.Student;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class StudenttestImpl implements  Studenttest {
    StudentDao mapper=null;

    public Student test() {
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext("application.xml");
        Student student= (Student) applicationContext.getBean("student");
//        SqlSessionFactoryBuilder builder=null;
//        SqlSession session=null;
//        try {
//            InputStream inputStream= Resources.getResourceAsStream("mybatis-config.xml");
//            SqlSessionFactory factory=new SqlSessionFactoryBuilder().build(inputStream);
//            session =factory.openSession();
//            mapper=session.getMapper(StudentMapper.class);
//            System.out.println("实现类是："+mapper);
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
        Student st=mapper.insertstudent(student.getStuname(),student.getStusex());
        return null;
    }
}
